/**
 * @(#)UserDao.java, 2018/2/2.
 * <p/>
 * Copyright 2018 Kerr Wang, Inc. All rights reserved.
 * KERRWANG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package org.wangzx.exercise.dao;

import org.springframework.stereotype.Repository;
import org.wangzx.exercise.meta.po.User;

import java.util.HashMap;
import java.util.Map;

/**
 * @author hzwangzuxiang(ahscwzx@163.com)
 */
@Repository("userDao")
public class UserDao extends AbstractDao<User> {

    public User getById(long id) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        return sqlSessionTemplate.selectOne(classStr + ".getById", map);
    }

    public User getByName(String name) {
        Map<String, Object> map = new HashMap<>();
        map.put("name", name);
        return sqlSessionTemplate.selectOne(classStr + ".getByName", map);
    }
}